package com.lanou.shunke.admin.service;

import com.github.pagehelper.PageHelper;
import com.lanou.shunke.admin.entity.TimeLine;
import com.lanou.shunke.admin.entity.TimelineClassification;
import com.lanou.shunke.admin.mapper.TimelineMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TimelineService {
    @Autowired
    private TimelineMapper mapper;

    public List<TimeLine> showAllTL(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return mapper.showAllTL();
    }

    public List<TimeLine> showTypeTag(int pageNum, int pageSize, int tagId) {
        PageHelper.startPage(pageNum, pageSize);
        return mapper.showTypeTag(tagId);
    }

    public List<TimelineClassification> showType() {
        return mapper.showType();
    }

    public void updateTagType(String tag, int tagId) {
        mapper.updateTagType(tag, tagId);
        mapper.updateTL(tag, tagId);
    }

    public List<TimeLine> showBanTL() {
        return mapper.showBanTL();
    }

    public void delBanTL(String timelineId) {
        mapper.delBanTL(timelineId);
    }


}
